<include file="common:__head__"/>
<div class="permissions-tabs">
    <a href="javascript:;" onclick="window.history.back();" style="margin: 18px 0 0 4px;"><img src="./Public/seller/images/permissions6.png"></a>
    <a class="role tabs-bg" href="javascript:;" mark="info">退款申请</a>
</div>


<form class="form-horizontal" id="brand_form" action="{:U('Order/edit')}" method="post">
<input type="hidden" name="order_id" value="{$order['id']}"/>
<div class="info">
    <div class="permissions-content">
        <div class="permissions-le">
            <div class="add-admin-ipt">
                <span><i>*</i>订单编号:</span>
                <input type="text" value="{$info.t_order_id}" class="w200" disabled/>
            </div>

            <div class="add-admin-ipt">
                <span><i>*</i>用户名称:</span>
                <input type="text" value="{$info.name}" class="w200" disabled/>
            </div>

            <div class="add-admin-ipt">
                <span><i>*</i>申请时间:</span>
                <input type="text" value="{$info.time}" class="w200" disabled/>
            </div>

            <div class="add-admin-ipt">
                <span><i>*</i>图片凭证:</span>
                <foreach name="pics" item="pic">
                    <a href="{$pic['img']}" onclick="" target="_blank">
                        <img src="{$pic['img']}" width="100" height="100">
                    </a>
                </foreach>
            </div>

            <div class="add-admin-ipt">
                <span><i>*</i>退款理由:</span>
                <input type="text" class="w200" value="{$info.reason}" disabled/>
            </div>

            <div class="add-admin-ipt">
                <span><i>*</i>买家备注:</span>
                <input type="text" value="{$info.remark}" class="w200" disabled/>
            </div>

            <div class="add-admin-ipt">
                <span><i>*</i>退款金额:</span>
               <if condition="$info['order_status'] neq 1">
                    <input id="store_dis_money" name="sitetitle" value="{$info['back_sum']}" class="w100" type="text" disabled/>
               <else/>
                    <input id="store_money" name="sitetitle" value="{$info['back_sum']}" class="w100" type="text" disabled/>
                </if>
            </div>

            <div class="add-admin-ipt">
                <span><i>*</i>审核说明{$order['judge_mes']}:</span>

                <notempty name="info['judge_time']">
                <dd class="opt">
                    <input class="judge" value="{$info['judge_mes']}" disabled>
                </dd>
                    <else/>
                    <dd class="opt">
                        <input class="judge" value="{$info['judge_mes']}">
                    </dd>
                </notempty>

            </div>

            <div class="add-admin-ipt">
                <span><i>*</i>是否通过:</span>
                    <switch name="info['order_status']">
                        <case value="1">
                            <select name="login_type" id="status">
                                <option value="2">通过</option>
                                <option value="3">不通过</option>
                            </select>
                        </case>
                        <case value="2">
                            <input name="sitetitle" value="通过" class="w100" type="text" disabled/>
                        </case>
                        <case value="3">
                            <input name="sitetitle" value="不通过" class="w100" type="text" disabled/>
                        </case>
                    </switch>
            </div>
            <form action="">
                <input type="hidden" value="{$order['id']}" id="order_id">
                <div class="permissions-table">
                    <table border="0" width="100%">
                        <thead>
                        <tr>
                            <td>商品ID</td>
                            <td>商品图片</td>
                            <td>商品名称</td>
                            <td>退货数量</td>
                            <td>价格小计</td>
                        </tr>
                        </thead>
                        <tbody class="trade-setting">
                            <tr>
                                <td>{$info['good_id']}</td>
                                <td>
                                    <a href="{:U('Good/edit',array('id'=>$info['good_id']))}" target="_blank">
                                        <img src="{$info['img']}" style="height: 30px;">
                                    </a>
                                </td>
                                <td>{$info['name']|cut_str='15',###}</td>
                                <td>{$info['num']}</td>
                                <td>{$info['back_sum']}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </form>


        </div>
        <div class="permissions-ri">
            <a href="" class="permissions-help">帮助和服务</a>
        </div>
    </div>
</div>

<div class="images" style="display: none;">
    <div class="permissions-content">
        <div class="permissions-le">
            <div class="goods_xc" style="width:100px; text-align:center; margin: 5px; display:inline-block;">
                <input type="hidden" name="goods_images[]" value="" class="goods_imgs"/>
                <a href="javascript:void(0);" onClick="GetUploadify(5,'','goods','call_back2');">
                    <img src="__PUBLIC__/images/img_upload.png" width="100" height="100" />
                </a>
            </div>
        </div>
    </div>
</div>

<div class="spec" style="display: none;">
    <div class="permissions-content">
        <div class="permissions-le">
             <div class="ncap-form-default tab_div_3">
                 <dl class="row">
                     <dt class="tit">
                         <label>商品规格&nbsp; <a class="plus_spec" href="javascript:;"><strong>[+]</strong></a></label>
                     </dt>
                     <dd class="opt">
                         <div class="spec_box">
                             <div style="margin-bottom:10px;" class="spec_k1">
                                 <select name="spe_1" class="small form-control spec1 spec_select">
                                     <option value="0" id="default">- 选择规格属性 -</option>
                                     <volist name="spec" id="vo">
                                         <option value="{$vo['id']}">{$vo['s_name']}</option>
                                     </volist>
                                 </select>
                                 <a class="p_plus" href="javascript:;" for="1"><strong>[+]</strong></a>
                             </div>
                             <div class="alisth1" style="margin-bottom:10px;"></div>
                         </div>
                     </dd>
                 </dl>
             </div>
        </div>
    </div>
</div>

<if condition="$info['order_status'] eq 1">
    <div style="padding: 0 0 10px 10px;">
        <button class="btn-lg btn-blue" id="submit">保存</button>
    </div>
</if>
</form>
<include file="common:__foot__"/>
<script type="text/javascript">
    $(function () {
      $("#submit").click(function () {
          var status = $("#status").val();
          layer.confirm('确认提交？', {btn: ['确定','取消'] }, function() {
              $.ajax({
                  url: "{:U('Order/return_good_info')}",
                  type: 'post',
                  data: {
                      judge: $(".judge").val(),
                      status: status,
                      order_id: "{$info.order_id}",
                      good_id: "{$info.good_id}",
                      back_sum: "{$info.back_sum}"
                  }, success: function (msg) {
                      if (msg == "1") {
                          layer.msg("审核成功", {time: 1000});
                          window.location.href = "{:U('Order/return_list')}";
                      }
                  }
              })
          })
      })
    })
</script>